import logging
from redis import StrictRedis
from datetime import timedelta
# 设置配置信息
class Config(object):
    debug = True
    #密钥
    SECRET_KEY = "HHHHH"
    # 数据库的配置消息
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/hu0426"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # resis 配置
    REDIS_HOST = "127.0.0.1"
    RESIS_PORT = 6379

    #3.配置session
    SESSION_TYPE="redis"
    SESSION_REDIS=StrictRedis(host=REDIS_HOST,port=RESIS_PORT)
    SESSION_USE_SIGNER= True
    #session保存的时间
    PERMANENT_SESSION_LIFETIME = timedelta(days=2)
    #默认的日志级别
    LEVEL =logging.DEBUG

#开发环境

class DevelopConfig(Config):
    pass

#生产环境

class ProductConfig(Config):
        DEBUG = True
        LEVEL = logging.DEBUG
#测试环境
class TestConfig(Config):
    TEST = True

config_test={
    "develop":DevelopConfig,
    "product":ProductConfig,
    "test":TestConfig
}